package com.book.controller;


import com.book.model.TReaders;
import com.book.service.TReadersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wx
 * @since 2023-10-13 10:37:37
 */
@RestController
@RequestMapping("/tReaders")
public class TReadersController {
    @Autowired
    private TReadersService tReadersService;

    @GetMapping("getAllReader")
    public List<TReaders> getAllReader(){

       return tReadersService.getAllReader();
    }

    @DeleteMapping("deleteReader")
    public void deleteReader(Long id){
        tReadersService.deleteReader(id);
    }
    @PostMapping("addReader")
    public void addReader(TReaders tReaders){
        tReadersService.addReader(tReaders);
    }
    @PutMapping("updateReader")
    public void updateReader(TReaders tReaders){
        tReadersService.updateReader(tReaders);
    }
}
